﻿Imports Cls_Common
Imports VSModel
Partial Class FrontEnd_Control_QuangCao_SliderNew
    Inherits System.Web.UI.UserControl

    Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearchHoSo.Click
        Response.Redirect(MainDomain & "tra-cuu-ho-so.html?s=" & txtSearchBienNhan.Text)
    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then

            Using _data As New VSEntities
                Dim p = (From q In _data.Stores Where q.StatusId = 3 Select q).ToList


                With rptHoKinhDoanh
                    .DataSource = p
                    .DataBind()
                End With


            End Using
        End If
    End Sub

    Protected Sub rptHoKinhDoanh_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles rptHoKinhDoanh.ItemDataBound
        Dim row As Store = e.Item.DataItem
        Dim hplTitle As HyperLink = CType(e.Item.FindControl("hplTitle"), HyperLink)
        hplTitle.NavigateUrl = MainDomain & "ho-kinh-doanh/" & row.QueryString & "-" & row.StoreId & ".html"
        'image
        Dim imgPreview As Image = CType(e.Item.FindControl("imgPreview"), Image)
        imgPreview.ImageUrl = row.ImgLogo

        'Title
        Dim lblTitle As Label = CType(e.Item.FindControl("lblTitle"), Label)
        lblTitle.Text = row.Title

    End Sub
End Class
